how to print the Level 1 header along with other data using dxl

 

 

In the below code snippet, can you please suggest along the belowstatus what i am printing also i need to print the Level 1 Heading under which the object ID is preseent

Since i am beginner in this dxl scripting i am asking some of the silly doubts, could you pelase help me in this regard.

 

//DXL Script to print the Pass/fail status.
 
 
Module m = current
 
Object o = null
 
string oot = ""
const string sOutFileName = "c:\\temp\\MyFile.csv" 
Stream out = write sOutFileName
int oid
int Count = 0
 
for o in m do {
 
oot = o."Test Classification"
 
if oot == "Step" then
 {
  oot = o."L3R2 Pass or Fail"
 
  if (oot == "Pass" or oot == "Fail") then 
  {
Count ++
 
    //print  oot
            //Do nothing
  }
  else
  {
oid = o."Absolute Number"
print oid "\t" "Pass/Fail status is not updated for this object ID" "\n"
out << oid "," "Pass/Fail missing" "\n"
 
  }
   }
 
 
 
}

 

 


lokeshchaitanya - Wed Feb 26 14:51:06 EST 2014

Re: how to print the Level 1 header along with other data using dxl
llandale - Wed Feb 26 15:39:10 EST 2014

Let me scribble a function that should help:

  • Object GetLevel1Parent(Object in_obj)
  • {  // get the ancestor object that is level 1.
  •    // if this object is level 1 then return that
  •    if (null in_obj) return(in_obj)   // coding error
  •    Object oParent = in_obj
  •    while (level(oParent) != 1)
  •    {  oParent = parent(oParent)
  •    }
  •    return(oParent)
  • }  // end GetLevel1Parent()

So your code can find this level 1 object and then print it's "Object Heading" value.

-Louie